package com.whminwei.edu.api.student.dto.feq;

import com.whminwei.common.constant.DataDictionary;
import com.whminwei.common.valid.IdNum;
import com.whminwei.common.valid.StringValues;
import com.whminwei.common.valid.ZhAndEn;
import com.whminwei.common.valid.validator.ZhAndEnValidator;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 学生数据
 *
 * @author wangy
 * @since 2024/5/17
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class StudentFeq {
    @Valid
    @NotEmpty(message = "学生信息不能为空")
    private List<StudentBo> studentBos;


    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class StudentBo {

        /**
         * 学生姓名
         */
        @ZhAndEn(min = 2, max = 25, message = "学生姓名不符合输入限制")
        private String studentName;

        /**
         * 学生学号
         */
        @ZhAndEn(min = 6, max = 6, mode = ZhAndEnValidator.ZhAndEnPattern.DIGIT, message = "学生学号不符合输入限制")
        private String studentNo;

        /**
         * 身份证号
         */
        @IdNum(message = "身份证号不符合公民身份号码编码规则")
        private String idNumber;

        /**
         * 性别
         */
        @StringValues(values = {DataDictionary.Gender.MALE, DataDictionary.Gender.FEMALE}, message = "性别不符合输入限制")
        private String gender;

        /**
         * 所在班级
         */
        @ZhAndEn(min = 2, max = 25, message = "班级名称不符合输入限制")
        private String classeName;

        /**
         * 注册手机号
         */
        private String registerPhone;

        /**
         * 行政区划编码
         */
        @ZhAndEn(min = 1, max = 200, message = "行政区划编码不符合输入限制")
        private String areaCode;

        /**
         * 住址
         */
        private String address;

        /**
         * 培养模式
         */
        @NotBlank(message = "培养模式不能为空")
        private String cultMode;

        private String leftPhotoFileId;

        private String rightPhotoFileId;

        private String centerPhotoFileId;


    }
}

